﻿<!--
// Author:   Murray Foxcroft - April 2009
// Comments: The primary WPF window that launches on startup 
-->
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FeedbackBrowser"
    x:Class="FeedbackBrowser.MainNotifyWindow" x:Name="uiMainNotifyWindow"
    Title="" Height="350" Width="377"
    ShowInTaskbar="False"
    WindowStyle="None" 
    AllowsTransparency="True" 
    ResizeMode="NoResize"
    Background="Transparent"
    MouseEnter="UiWindowMainNotificationMouseEnter"
    MouseLeave="UiWindowMainNotificationMouseLeave" 
    Visibility="Visible" 
    Topmost="True" 
    BorderThickness="1" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    <Window.Resources>
        <Style x:Key="myHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
        <Storyboard x:Key="gridFadeInStoryBoard">
            <DoubleAnimation Storyboard.TargetName="uiGridMain" BeginTime="0:0:0.1"
                Storyboard.TargetProperty="Opacity" From="0.00" To="1.00" AutoReverse="False" Duration="0:0:0.3" />
        </Storyboard>
        <Storyboard x:Key="gridFadeOutStoryBoard">
            <DoubleAnimation Storyboard.TargetName="uiGridMain" BeginTime="0:0:0.5"
                Storyboard.TargetProperty="Opacity" From="1.00" To="0.00" AutoReverse="False" Duration="0:0:0.3" />
        </Storyboard>
        <DataTemplate x:Key="BlueHeader">
            <StackPanel Orientation="Horizontal" Margin="-5,-5,-5,-5" Width="120">
                <StackPanel.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF223B84" Offset="1"/>
                        <GradientStop Color="#FF57A0F4" Offset="0.5"/>
                        <GradientStop Color="#FF4B94EC" Offset="0.5"/>
                    </LinearGradientBrush>
                </StackPanel.Background>
                <TextBlock Margin="10,10,10,10" Text="{Binding}" 
		VerticalAlignment="Center"  Foreground="White"/>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    <Border CornerRadius="5">
        <Grid x:Name="uiGridMain" Margin="10">
            <Border Width="Auto" Height="Auto" Style="{StaticResource MainGridBorder}">
            </Border>
            <Grid Margin="5,0,12,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="0"/>
                    <RowDefinition Height="18" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="36" />
                    <ColumnDefinition Width="42" />
                </Grid.ColumnDefinitions>
                <local:SlickToggleButton CornerRadius="0,0,0,4" x:Name="PinButton" Style="{StaticResource SlickButton}" HighlightBackground="Blue" PressedBackground="DarkBlue" Grid.Column="1" Grid.Row="1" FontWeight="Bold" Click="PinButtonClick">
                    <Image x:Name="PinImage" Source="pack://application:,,/Images/Un-Pinned.png" Stretch="None"/>
                </local:SlickToggleButton>
                <local:SlickToggleButton CornerRadius="0,0,4,0" x:Name="CloseButton" Style="{StaticResource SlickButton}" HighlightBackground="Red" Content="X" Click="CloseButtonClick" Grid.Row="1" FontWeight="Bold" Foreground="#FFFFFFFF" Grid.Column="2" />
            </Grid>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="44"/>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="44"/>
                </Grid.RowDefinitions>
                <local:HorizontalSeparator d:LayoutOverrides="HorizontalAlignment" Grid.Row="1"/>
                <local:HorizontalSeparator d:LayoutOverrides="HorizontalAlignment" Grid.Row="5"/>
                <Label Margin="5,3.395,79,15" x:Name="TitleLabel" Foreground="White" Opacity="0.9" Content="Feedback Browser"/>
                <StackPanel Grid.Row="1" Margin="10,10,10,10"></StackPanel>
                <StackPanel FlowDirection="LeftToRight" Orientation="Horizontal" Margin="10,5,5,5" Grid.Row="2">
                    <Button x:Name="btnConfigure" MouseEnter="BtnConfigureMouseEnter" Cursor="Hand" ToolTip="Choose team project" Click="BtnConfigureClick">
                    	<Button.Effect>
                    		<DropShadowEffect/>
                    	</Button.Effect>
                        <Button.Template>
                            <ControlTemplate>
                                <Border HorizontalAlignment="Center" VerticalAlignment="Center" >
                                    <Image x:Name="imgIcon" Source="pack://application:,,/Images/icon_settings-big.png" 
                               Width="32" 
                               Height="32"/>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger SourceName="imgIcon" Property="IsMouseOver" Value="True">
                                    </Trigger>
                                </ControlTemplate.Triggers>

                            </ControlTemplate>
                        </Button.Template>
                        <!--<Button.Triggers>
                            <EventTrigger RoutedEvent="Button.MouseEnter">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>

                            </EventTrigger>
                            <EventTrigger RoutedEvent="Button.MouseLeave">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                        </Button.Triggers>-->
                    </Button>
                    <Rectangle Height="32" Name="rectangle1" Width="13" Margin="0,1" Cursor="Hand" ToolTip="Refresh list" />
                    <Button x:Name="btnRefresh" Cursor="Hand" ToolTip="Refresh" Click="BtnRefreshClick">
                        <Button.Effect>
                            <DropShadowEffect/>
                        </Button.Effect>
                        <Button.Template>
                            <ControlTemplate>
                                <Border HorizontalAlignment="Center" VerticalAlignment="Center" >
                                    <Image Source="pack://application:,,/Images/refresh.png" 
                               Width="32" 
                               Height="32"/>
                                </Border>
                            </ControlTemplate>
                        </Button.Template>
                    </Button>

                </StackPanel>
                <ListView Name="lstFeedbackRequests" Margin="10,10,13,15"  ItemsSource="{Binding WorkItemCollection}"  Grid.Row="1" SelectionMode="Single">
                    <!--<ListView.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Start Feedback Client" Click="MenuItemClick" />
                        </ContextMenu>
                    </ListView.ContextMenu>-->
                    <ListView.View>
                        <GridView ColumnHeaderContainerStyle="{StaticResource myHeaderStyle}">
                            <GridViewColumn DisplayMemberBinding="{Binding Path=Title}" Width="255" />
                            <GridViewColumn Header="Start Feedbacj Client">
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Margin="6,2,6,2">
                                            <Button x:Name="btnStart" Cursor="Hand" ToolTip="Start Feedback Client" Click="StartClick">
                                                <Button.Effect>
                                                    <DropShadowEffect/>
                                                </Button.Effect>
                                                <Button.Template>
                                                    <ControlTemplate>
                                                        <Border HorizontalAlignment="Center" VerticalAlignment="Center" >
                                                            <Image x:Name="imgIcon" Source="pack://application:,,/Images/feedbackIcon.png" 
                               Width="20" 
                               Height="20"/>
                                                        </Border>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger SourceName="imgIcon" Property="IsMouseOver" Value="True">
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>

                                                    </ControlTemplate>
                                                </Button.Template>
                                             
                                            </Button>
                                        </StackPanel>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        </GridView>
                    </ListView.View>
                    <ListView.Background>
                        <LinearGradientBrush EndPoint="0.939,0.919" StartPoint="0.061,0.081">
                            <GradientStop Color="#FFFBFDFF" Offset="0" />
                            <GradientStop Color="#FFEEF5FF" Offset="1" />
                        </LinearGradientBrush>
                    </ListView.Background>
                    <ListView.ItemContainerStyle>
                        <Style TargetType="{x:Type ListViewItem}">
                            <Setter Property="Height" Value="34" />
                            <Setter Property="Background" Value="#FFFBFDFF" />
                            <Setter Property="Foreground" Value="#FF4B94EC" />
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Foreground" Value="MediumSlateBlue" />
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#E6EBF4FF" Offset="0.986" />
                                                <GradientStop Color="#FFD2E6FF" Offset="0.5" />
                                                <GradientStop Color="#FFD2E6FF" Offset="0.51" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </ListView.ItemContainerStyle>
                </ListView>
            </Grid>
        </Grid>
    </Border>
</Window>
